<?php
/**
 * Created by PhpStorm
 * User: shen.zk
 * Date: 2023/10/26
 * Time: 09:51
 * Comment: ''
 */

namespace App\Http\Controllers\Common;

use App\Common\ResponseCode;
use App\Http\Controllers\BaseController;
use App\Params\Common\CastingAccountParam;
use App\Params\Common\MerchantsCastingLogParam;
use App\Service\Common\MerchantsCastingService;

class MerchantsCastingController extends BaseController
{
    /**
     * 商户铸造数量更新
     * @return \Illuminate\Http\JsonResponse
     * @throws \App\Exceptions\BusinessException
     * @author shen.zk
     * @date 2023-10-26 17:26
     */
    public function castingAccount()
    {
        $param = CastingAccountParam::create();
        $result = MerchantsCastingService::getInstance()->castingAccountService($param);
        if ($result)
            return $this->success();
        return $this->fail(ResponseCode::FAIL);
    }

    /**
     * 获取创作者铸造数量变更日志
     * @return \Illuminate\Http\JsonResponse
     * @throws \App\Exceptions\BusinessException
     * @author shen.zk
     * @date 2023-10-26 17:45
     */
    public function getMerchantsCastingLog()
    {
        $param = MerchantsCastingLogParam::create();
        $result = MerchantsCastingService::getInstance()->getMerchantsCastingLogService($param);
        return $this->success($result);
    }
}
